<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'auth'], function () {
    Route::post('login', 'AuthController@login');
});

//Route::group(['middleware' => 'auth:admin'], function () {
    Route::get('consultants', 'ConsultantsController@index');

    // 管理员管理
    Route::post('admin_users', 'AdminUsersController@store');
    Route::get('admin_users', 'AdminUsersController@index');
    Route::put('admin_users/{user}', 'AdminUsersController@update');
    Route::delete('admin_users/{user}', 'AdminUsersController@destroy');

    Route::group(['prefix' => 'wechat'], function () {
        // 自定义菜单
        Route::get('menus', 'WechatMenusController@index');
        Route::post('menus', 'WechatMenusController@store');

        // 自动回复
        Route::get('replies', 'WechatAutoRepliesController@index');
        Route::group(['prefix' => 'replies'], function () {
            Route::get('keyword', 'WechatAutoRepliesController@keywordIndex');
            Route::post('keyword', 'WechatAutoRepliesController@storeKeywordsReply');

            Route::get('subscribe', 'WechatAutoRepliesController@subscribeIndex');
            Route::post('subscribe', 'WechatAutoRepliesController@storeSubscribeReply');

            Route::post('normal', 'WechatAutoRepliesController@storeNormalReply');
        });


        // 素材管理
        Route::group(['prefix' => 'materials'], function () {
            Route::get('news', 'WechatMaterialsController@newsIndex');
            Route::get('images', 'WechatMaterialsController@imagesIndex');
            Route::get('sync_news', "WechatMaterialsController@syncNews");
            Route::get('sync_images', 'WechatMaterialsController@syncImages');
            Route::post('news_image', 'WechatMaterialsController@uploadNewsImage');
            Route::post('image', 'WechatMaterialsController@storeImage');
            Route::post('news', 'WechatMaterialsController@storeNews');
        });
    });
//});



